import { Context } from 'koa'
import { success, insert } from '../utils/index'

export class DemoController {
  static async postData(ctx: Context) {
    const { name, apiTablePathName, hasTableBtn, config } = ctx.request.body as any
    const result = await insert('table_config', { name, apiTablePathName, hasTableBtn, config })
    ctx.body = success(ctx, result)
  }
}
